import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:niuren_demo/configs/Colors_util.dart';
import 'package:niuren_demo/model/EntrustItem_model.dart';
import 'package:niuren_demo/page/dynamic/contant/transaction/entrust_page.dart';
import 'package:niuren_demo/view/text/text_style.dart';

class EntrustItem extends StatelessWidget {
  final EntrustItem_Model dataModel;
  final bool showtip2color;

  const EntrustItem({Key key, this.dataModel, this.showtip2color})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: 16),
      child: Column(
        children: [
          SizedBox(height: 20,),
          Row(
            children: [
              Text_style(
                data: "${dataModel.date}",
                fontSize: 14,
                color: Colors.black,
              ),
              SizedBox(
                width: 8,
              ),
              Expanded(
                child: Text_style(
                  data: "${dataModel.time}",
                  fontSize: 14,
                  color: Colors.black,
                ),
              ),
              Text_style(
                data: "${dataModel.tip1}",
                fontSize: 12,
              ),
              SizedBox(
                width: 12,
              ),
              Text_style(
                data: "${dataModel.tip2}",
                fontSize: 12,
              ),
            ],
          ),
          SizedBox(height: 20,),
          Row(
            children: [
              Expanded(
                child: Row(
                  children: [
                    Text_style(
                      data: "数量:",
                      color: Colors.grey,
                    ),
                    Text_style(
                      data: "${dataModel.num}",
                    ),
                  ],
                ),
              ),
              Row(
                children: [
                  Text_style(
                    data: "价格:",
                    color: Colors.grey,
                  ),
                  Text_style(
                    data: "${dataModel.price}",
                  ),
                ],
              ),
            ],
          ),
          SizedBox(height: 15,),
          buildBottom(),

        ],
      ),
    );
  }

  Widget buildBottom() {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: [
        Column(
          children: [
            Text_style(
              data: "${dataModel.documentary}",
              fontSize: 18,
            ),
            Text_style(
              data: "跟单",
              color: Colors.grey,
            ),
          ],
        ),
        Column(
          children: [
            Text_style(
              data: "${dataModel.entrust}",
              fontSize: 18,
            ),
            Text_style(
              data: "委托",
              color: Colors.grey,
            ),
          ],
        ),
        Column(
          children: [
            Text_style(
              data: "${dataModel.revoke}",
              fontSize: 18,
            ),
            Text_style(
              data: "撤销",
              color: Colors.grey,
            ),
          ],
        ),
        Column(
          children: [
            Text_style(
              data: "${dataModel.deal}",
              fontSize: 18,
            ),
            Text_style(
              data: "成交",
              color: Colors.grey,
            ),
          ],
        ),
      ],
    );
  }
}
